home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
cuj9204.zip
/
1004091A
< prev
next >
Wrap
Text File
|
1992-06-02
|
506b
|
25 lines
#include <stdio.h>
#include <stdlib.h>
#define NUMELEMENTS(x) (sizeof(x)/sizeof(x[0]))
#define INT 1
#define LONG 2
#define DOUBLE 3
typedef struct {
const char *stack_name;
void *pstack;
const int type; /* type of entries */
size_t stack_ptr;
size_t max_stack;
} stack;
int array1[10];
static long array2[30];
stack stack1 = {"stack1", array1, INT, 0, NUMELEMENTS(array1)};
stack stack2 = {"stack2", array2, LONG, 0, NUMELEMENTS(array2)};
stack stack3 = {"stack3", NULL, DOUBLE, 0, 0};